#include "fxcc/yml/Serializer.h"
#include "fxcc/core/graph/common/Bone.h"

using namespace fxcc::yml;
using CType = fxcc::graph::common::Bone;;

template<>
void Serializer::Encode<CType>(YAML::Node& node, const CType& inst)
{

    SetVariable<std::string>(node,  "m_Name",inst.m_Name);
    SetVariable<unsigned int>(node, "m_Index", inst.m_Index);
    SetVariable<fxcc::graph::common::Transform>(node , "m_OffsetMatrix", inst.m_OffsetMatrix);
    //SetVariable<fxcc::graph::common::VoidPtrMap>(node, "m_PtrMap", inst.m_PtrMap);

}


template<>
bool Serializer::Decode<CType>(const YAML::Node& node, CType& inst)
{
    GetVariable<std::string>(node, "m_Name", inst.m_Name);
    GetVariable<unsigned int>(node, "m_Index", inst.m_Index);
    GetVariable<fxcc::graph::common::Transform>(node, "m_OffsetMatrix", inst.m_OffsetMatrix);
    //GetVariable<fxcc::graph::common::VoidPtrMap>(node, "m_PtrMap", inst.m_PtrMap);

	return true;
}
